<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    var a = Math.random() * 8999;
    var b = Math.round(a +1000);
    // var b=2000;
    console.log(b);
    var c = b % 4;
    console.log(c);
    var d = b % 100;
    console.log(d);
    var e = b % 400;
    console.log(e);

    // if(c == 0 && d != 0 || e == 0){
    //     document.write(b + "年是闰年");
    // }else{
    //     document.write(b + "年不是闰年");
    // }

    if(c == 0 && d != 0){
        document.write(b + "年是普通闰年");
    }else if(e == 0){
        document.write(b + "年是世纪闰年");
    }else{
        document.write(b + "年不是闰年");
    }
</script>
</html>